#ifndef _ENCODER_H_
#define _ENCODER_H_

#define Select_Wheel  2
#define  Select_Motor 3


typedef struct Econder_Operation_struct
{ int encoder_wheel_count;
	int encoder_motor_count;
	void (*Encoder_Init)(void);
	int (*Read_Encoders)(char TIMX);

}TEconder_Operation,*PTEconder_Operation;

extern TEconder_Operation Econder_Operation;


short   Enc_GetCount(void)  ;
#define ENCODER_TIMER   TIM1  
#define ENCODER_PPR           (u16)(100)   
#define SPEED_BUFFER_SIZE 8  
#define COUNTER_RESET   (u16)0  
#define ICx_FILTER      (u8) 6 // 
#define TIMx_PRE_EMPTION_PRIORITY 1  
#define TIMx_SUB_PRIORITY 0  
#define ENCODER_TIM_PERIOD 0xffff
#define MAX_COUNT          10000

#include "stm32f10x.h"
#include "sys.h" 
#include "delay.h"
#endif
